﻿<?php
session_start();
require_once(dirname(__FILE__)."/../libs/dbclass/dbconnect.php");
require_once(dirname(__FILE__)."/../libs/string/libstr.php");
require_once(dirname(__FILE__)."/../libs/shijuan/sj_class.php");
require_once(dirname(__FILE__)."/../libs/public/public_func.php");
$sj=new shijuan();
$mc= new libstr();
$dl=new deal_class();

$xueduanID=$_GET["xueduanID"];
$xuekeID=$_GET["xuekeID"];

header("Content-Type:text/xml;");
echo '<?xml version="1.0" encoding="utf-8"'.'?'.'>';
echo '<tree id="0">';
echo '<item text="知识点" id="-1" open="1" call="1" select="1">';
echo getclass(0,$xuekeID,$xueduanID);
function getclass($cataid=0){
	
	global $db;
	global $mc;
	

 $sql="select ID,classname,xuekeID,nianjiID,xueqiID,rootid,(select count(b.ID) as tt from test_class as b where b.pid=t.ID) as tj from test_class as t where t.pid=".$cataid."  ";
 $getrs=$db->ds($sql);
 if(count($getrs)>0){
for($i=0;$i<count($getrs);$i++){
	  echo '<item text="'.$getrs[$i][classname].'" id="'.$getrs[$i][ID].'">';
	getclass($getrs[$i][ID]);
}
 }
 echo '</item>';
}
echo '</tree>';
?>

